<?php echo $header; ?>
<div id="content">
   <div class="breadcrumb">
    <?php echo $this->breadCrumbs(); ?>
  </div>
  <?php if (isset($error_warning)) { ?>
  <div class="warning"><?php echo $error_warning; ?></div>
  <?php } ?>
  <?php if ($success) { ?>
  <div class="success"><?php echo $success; ?></div>
  <?php } ?>
  <div class="box">
    <div class="heading">
      <h1><img src="view/image/product.png" alt="" />产品采集</h1>
      <div class="buttons">
      <a onclick="location = '<?php echo UA('tool/collection/insert'); ?>'" class="button"><span>添加节点</span></a>
      <a onclick="$('#form').submit();" class="button"><span>删除节点</span></a>
      <a onclick="location = '<?php echo UA('tool/collection/funcs'); ?>'" class="button"><span>处理函数</span></a>      
      </div>
    </div>
    <div class="content">
      <form action="<?php echo UA('tool/collection/delete'); ?>" method="post" enctype="multipart/form-data" id="form">
        <table class="list">
          <thead>
            <tr height="30">
              <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></td>
              <td width="50">ID</td>
			  <td>网站</td>
			  <td>节点</td>
			  <td>最近采集</td>
			  <td>产品数</td>
			  <td>状态</td>
			  <td>采集</td>
			  <td>数据</td>
			  <td>操作</td>
            </tr>
          </thead>
          <tbody>
            <?php if ($nodes) { ?>
            <?php foreach ($nodes as $node) { ?>
            <tr  height="30" onmouseover="this.className='on';" onmouseout="this.className='';">
              <td style="text-align: center;">
              <input type="checkbox" name="selected[]" value="<?php echo $node['id']; ?>" /></td>
              <td><?php echo $node['id']; ?></td>
			  <td><a href="<?php echo $node['site_url']; ?>" target="_blank"><?php echo $node['site_name']; ?></a></td>
			  <td><?php echo $node['node_title']; ?></td>
			  <td><?php echo $node['last_time'] > 0 ? date('Y-m-d H:i', $node['last_time']) : ''; ?></td>
			  <td><?php echo $node['total']; ?></td>
			  <td><?php echo $node['status'] == 0? '未采集' : ($node['status'] == 1 ? '未完成' : '已完成'); ?></td>
			  <td>
			  [<a href="<?php echo UA('tool/collection/ctest'); ?>&id=<?php echo $node['id']?>" target="_blank">预览</a>]
			  [<a href="<?php echo UA('tool/collection/clist'); ?>&id=<?php echo $node['id']?>">采集网址</a>]
			  [<a href="<?php echo UA('tool/collection/ccontent'); ?>&id=<?php echo $node['id']?>">采集产品</a>]
			  
			  </td>
			  <td>
			  [<a href="<?php echo UA('tool/collection/cclear'); ?>&id=<?php echo $node['id']?>" onclick="return confirm('清空采集数据?');">清空</a>]
			  [<a href="<?php echo UA('tool/collection/cdata'); ?>&id=<?php echo $node['id']?>">数据</a>]
			  </td>			  
			  <td>				
			  [<a href="<?php echo UA('tool/collection/update'); ?>&id=<?php echo $node['id']?>">编辑</a>]
			  [<a href="<?php echo UA('tool/collection/copy'); ?>&id=<?php echo $node['id']?>">复制</a>]
			  </td>
            </tr>
            <?php } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="15"><?php echo $_['text_no_results']; ?></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
      </form>
	  <div class="pagination"><?php echo $pagination; ?></div>
    </div>
  </div>
</div>
<?php echo $footer; ?>